<extend name="Member:base" />
<block name="title"><title>心心向善-账户信息</title></block>
		<!-- 头部结束-->
<block name="body">
			
			<!--<主要区块>-->
			<div class="right-layout">
				<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/jquery.ui.css">

				<div class="wrap">
					<div class="tabmenu">
						<ul class="tab pngFix">
							<li class="active">
								<a href="#">基本信息</a>
							</li>
							<li class="normal">
								<a href="/member/xgtx.html">更换头像</a>
							</li>
						</ul>
					</div>
					<div class="ncm-user-profile">
						<div class="user-avatar">						
							<if condition="$UserInfo.userpic eq ''" >
							<img src="__PUBLIC__/Home/images/default_user_portrait.gif">
							<else/>
							<img src="{$UserInfo.userpic}" style="max-width: 120px;max-height: 120px;">
							</if>					
						</div>
						<div class="ncm-default-form fr">
							<form method="post" id="profile_form" action="edit_info">
								<dl>
									<dt>用户名称：</dt>
									<dd>
										<span class="w400">{$UserInfo.username}&nbsp;&nbsp;
											<div class="nc-grade-mini" style="cursor:pointer;">V{$UserInfo.gotegary}</div>
										</span>
										<span>&nbsp;&nbsp;隐私设置</span>
									</dd>
								</dl>
								<dl>
									<dt>邮箱：</dt>
									<dd>
										<span class="w400">
											<if condition="$UserInfo.mmemail eq ''" >
												<a href="yzyx.html">绑定邮箱</a>
											<else/>
												{$UserInfo.mmemail}&nbsp;&nbsp;<a href="#">更换邮箱</a>
											</if>										
										</span>
										<span>
											<select name="privacy[email]">
											  <option value="0" selected="selected">公开</option>
											  <option value="1">好友可见</option>
											  <option value="2">保密</option>
											</select>
										</span>
									</dd>
								</dl>
								<dl>
									<dt>真实姓名：</dt>
									<dd>
									<span class="w400">
										<input type="text" class="text" maxlength="20" name="member_truename" id="member_truename" value="{$UserInfo.realname}">
									</span>
									<span>
										<select name="privacy[truename]">
										  <option value="0" selected="selected">公开</option>
										  <option value="1">好友可见</option>
										  <option value="2">保密</option>
										</select>
									</span>
								</dd>
								</dl>
								<dl>
									<dt>性别：</dt>
									<dd><span class="w400">
											
										<label>
										  <input type="radio" name="member_sex" value="3"<if condition="$UserInfo.sex eq '3'" >checked="checked"</if> >
										  保密</label>
										&nbsp;&nbsp;
										<label>
										  <input type="radio" name="member_sex" value="2" <if condition="$UserInfo.sex eq '2'" >checked="checked"</if>>
										  女</label>
										&nbsp;&nbsp;
										<label>
										  <input type="radio" name="member_sex" value="1" <if condition="$UserInfo.sex eq '1'" >checked="checked"</if>>
										  男</label>
										</span><span>
										<select name="privacy[sex]">
										  <option value="0" selected="selected">公开</option>
										  <option value="1">好友可见</option>
										  <option value="2">保密</option>
										</select>
										</span>
									</dd>
								</dl>
								<!--<dl>
									<dt>生日：</dt>
									<dd><span class="w400">
										<input type="text" class="text hasDatepicker" name="birthday" maxlength="10" id="birthday" value="" readonly="readonly">
										</span><span>
										<select name="privacy[birthday]">
										  <option value="0" selected="selected">公开</option>
										  <option value="1">好友可见</option>
										  <option value="2">保密</option>
										</select>
										</span>
									</dd>
								</dl>-->
								<dl>
									<dt>所在地区：</dt>
									<dd><span id="region" class="w400">

										<select name="province" id="code">
											<if condition="$UserInfo.province eq ''" >
											<option >请选择省份</option>
											<else/>
											<option value="{$UserInfo.province}">{$UserInfo.province}</option>
											</if>
										
										<volist name="code" id="vo">						
											  <option value ="{$vo.area_name}" data-id="{$vo.area_id}">{$vo.area_name}</option>						
										</volist>
										</select>
										<select id="cobb" name="city">
											<if condition="$UserInfo.city eq ''" >
											<option ></option>
											<else/>
											<option value="{$UserInfo.city}">{$UserInfo.city}</option>
											</if>	
										<volist name="citylist" id="vo">						
											  <option value ="{$vo.area_name}" data-id="{$vo.area_id}">{$vo.area_name}</option>						
										</volist>
										</select>
										
										<select id="cocc" name="area">
											<if condition="$UserInfo.area eq ''" >
											<option ></option>
											<else/>
											<option value="{$UserInfo.area}">{$UserInfo.area}</option>
											</if>
										<volist name="cityson" id="vo">						
											  <option value ="{$vo.area_name}" data-id="{$vo.area_id}">{$vo.area_name}</option>						
										</volist>					
										</select>
										</span>
										<span>		
										<select name="privacy[area]">
										  <option value="0" selected="selected">公开</option>
										  <option value="1">好友可见</option>
										  <option value="2">保密</option>
										</select>
										</span>
									</dd>
								</dl>
<!-- 								<dl>
									<dt>QQ：</dt>
									<dd><span class="w400">
										<input type="text" class="text" maxlength="30" name="member_qq" value="">
										</span><span>
										<select name="privacy[qq]">
										  <option value="0" selected="selected">公开</option>
										  <option value="1">好友可见</option>
										  <option value="2">保密</option>
										</select>
										</span> 
									</dd>
								</dl> -->
								<dl class="bottom">
									<dt></dt>
									<dd>
										<label class="submit-border">
										  <input type="hidden" name="Infohash" id="Infohash" value="">
										  <input type="submit" class="submit" id="gosubmit" value="保存修改">
										</label>
									</dd>
								</dl>
							</form>
						</div>
					</div>
				</div>
				<script type="text/javascript" src="__PUBLIC__/Home/js/common_select.js" charset="utf-8"></script>

		
    <script>
        $('#code').change(function(){
			var name = $(this).val();
            var code = $(this).find("option[value='"+name+"']").attr("data-id");
			var url = '{:U("/shop/code_chage")}';
			//alert(code);
			if (code) {			
				$.ajax({
					url:url,
					data:{id:code},
					type:'post',
					//dataType:'json',
					success:function (data) {
						var a = data;
						var html = '';
						for(var i=0;i<a.length;i++ ) {
							
							html += '<option value ="'+a[i].area_name+'" data-id="'+a[i].area_id+'">'+a[i].area_name+'</option>';
						}
						
						 $("#cobb").html(html);						
					}
				});
				var parent =$(this).val();
				$.ajax({
					url:url,
					data:{id:code,parent:parent},
					type:'post',
					//dataType:'json',
					success:function (data) {
						var a = data;
						var html2 = '';
						for(var i=0;i<data.length;i++ ) {
							
							html2 += '<option value ="'+data[i].area_name+'" data-id="'+data[i].area_id+'">'+data[i].area_name+'</option>';
						}
						//alert(html);
						 $("#cocc").html(html2);						
					}
				});					
			}
			

        });
		
        $('#cobb').change(function(){
			var name = $(this).val();
            var code = $(this).find("option[value='"+name+"']").attr("data-id");
			//alert(code);
			var url = '{:U("/shop/code_chage")}';
			if (code) {			
				$.ajax({
					url:url,
					data:{id:code},
					type:'post',
					//dataType:'json',
					success:function (data) {
						var a = data;
						var html2 = '';
						for(var i=0;i<data.length;i++ ) {
							
							html2 += '<option value ="'+data[i].area_name+'" data-id="'+data[i].area_id+'">'+data[i].area_name+'</option>';
						}
						
						 $("#cocc").html(html2);						
					}
				});					
			}
        });		
    </script>
	<script type="text/javascript">
	$(function(){

		$('input').change(function(){
			$("#Infohash").val(_getRandomString(32));

		});
		$('select').change(function(){
			$("#Infohash").val(_getRandomString(32));
		});
	});
	

	// 获取长度为len的随机字符串  
	function _getRandomString(len) {  
		len = len || 32;  
		var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1  
		var maxPos = $chars.length;  
		var pwd = '';  
		for (i = 0; i < len; i++) {  
			pwd += $chars.charAt(Math.floor(Math.random() * maxPos));  
		}  
		return pwd;  
	} 
  </script>
				<script charset="utf-8" type="text/javascript" src="__PUBLIC__/Home/js/zh-CN.js"></script>
			</div>
			<!--</主要区块>-->
			<div class="clear"></div>
		</div>
</block>